﻿@model MusicStore.WebMVC.ViewModels.ShoppingCartViewModel

@{
    ViewBag.Title = "Index of shopping cart";
}

<script src="@Url.Content("~/Scripts/ShoppingCart.js")" type="text/javascript"></script>

<h2>Review your cart</h2>

<p class = "button">
    @Html.ActionLink("Checkout >>", "AddressAndPayment", "Checkout")
</p>

<div id="update-message"></div>

<table>
    <tr>
         <th> 
            Album Name 
        </th> 
        <th> 
            Price (each) 
        </th> 
        <th> 
            Quantity 
        </th> 
        <th></th>
    </tr>

    @foreach (var item in Model.CartItems) {
        <tr id = "row-@item.RecordId">
            <td>
                @Html.ActionLink(item.Album.Title, "Details", "Store", new { id = item.AlbumId }, null)
            </td>
            <td>
                @item.Album.Price
            </td>
            <td id ="item-count-@item.RecordId">
                @item.Count
            </td>
            <td>
                <a href="#" class="RemoveLink" data-id="@item.RecordId">Remove from cart</a>
            </td>
        </tr>
    }

    <tr> 
        <td> 
            Total 
        </td> 
        <td> 
        </td> 
        <td> 
        </td> 
        <td id="cart-total"> 
            @Model.CartTotal 
        </td> 
    </tr>
</table>
